.class final Les/jp0$b;
.super Ljava/nio/charset/CharsetEncoder;
.source "ByteCharset.java"


# annotations
.annotation system Ldalvik/annotation/EnclosingClass;
    value = Les/jp0;
.end annotation

.annotation system Ldalvik/annotation/InnerClass;
    accessFlags = 0x1a
    name = "b"
.end annotation


# instance fields
.field private a:[B


# direct methods
.method constructor <init>(Les/jp0;)V
    .locals 5

    const/high16 v0, 0x3f800000    # 1.0f

    .line 1
    invoke-direct {p0, p1, v0, v0}, Ljava/nio/charset/CharsetEncoder;-><init>(Ljava/nio/charset/Charset;FF)V

    .line 2
    invoke-virtual {p1}, Les/jp0;->a()[C

    move-result-object p1

    const/4 v0, 0x0

    const/4 v1, 0x0

    const/4 v2, 0x0

    .line 3
    :goto_0
    array-length v3, p1

    const v4, 0xfffd

    if-lt v1, v3, :cond_2

    add-int/lit8 v2, v2, 0x1

    .line 4
    new-array v1, v2, [B

    iput-object v1, p0, Les/jp0$b;->a:[B

    .line 5
    :goto_1
    array-length v1, p1

    if-lt v0, v1, :cond_0

    return-void

    .line 6
    :cond_0
    aget-char v1, p1, v0

    if-eqz v1, :cond_1

    if-ge v1, v4, :cond_1

    .line 7
    iget-object v2, p0, Les/jp0$b;->a:[B

    int-to-byte v3, v0

    aput-byte v3, v2, v1

    :cond_1
    add-int/lit8 v0, v0, 0x1

    goto :goto_1

    .line 8
    :cond_2
    aget-char v3, p1, v1

    if-le v3, v2, :cond_3

    if-ge v3, v4, :cond_3

    move v2, v3

    :cond_3
    add-int/lit8 v1, v1, 0x1

    goto :goto_0
.end method


# virtual methods
.method protected encodeLoop(Ljava/nio/CharBuffer;Ljava/nio/ByteBuffer;)Ljava/nio/charset/CoderResult;
    .locals 4

    .line 1
    :goto_0
    invoke-virtual {p1}, Ljava/nio/CharBuffer;->hasRemaining()Z

    move-result v0

    if-nez v0, :cond_0

    .line 2
    sget-object p1, Ljava/nio/charset/CoderResult;->UNDERFLOW:Ljava/nio/charset/CoderResult;

    return-object p1

    .line 3
    :cond_0
    invoke-virtual {p1}, Ljava/nio/CharBuffer;->get()C

    move-result v0

    .line 4
    invoke-virtual {p2}, Ljava/nio/ByteBuffer;->hasRemaining()Z

    move-result v1

    const/4 v2, 0x1

    if-nez v1, :cond_1

    .line 5
    invoke-virtual {p1}, Ljava/nio/CharBuffer;->position()I

    move-result p2

    sub-int/2addr p2, v2

    invoke-virtual {p1, p2}, Ljava/nio/CharBuffer;->position(I)Ljava/nio/Buffer;

    .line 6
    sget-object p1, Ljava/nio/charset/CoderResult;->OVERFLOW:Ljava/nio/charset/CoderResult;

    return-object p1

    .line 7
    :cond_1
    iget-object v1, p0, Les/jp0$b;->a:[B

    array-length v3, v1

    if-ge v0, v3, :cond_2

    aget-byte v1, v1, v0

    goto :goto_1

    :cond_2
    const/4 v1, 0x0

    :goto_1
    if-nez v1, :cond_4

    if-nez v0, :cond_3

    goto :goto_2

    .line 8
    :cond_3
    invoke-virtual {p1}, Ljava/nio/CharBuffer;->position()I

    move-result p2

    sub-int/2addr p2, v2

    invoke-virtual {p1, p2}, Ljava/nio/CharBuffer;->position(I)Ljava/nio/Buffer;

    .line 9
    invoke-static {v2}, Ljava/nio/charset/CoderResult;->unmappableForLength(I)Ljava/nio/charset/CoderResult;

    move-result-object p1

    return-object p1

    .line 10
    :cond_4
    :goto_2
    invoke-virtual {p2, v1}, Ljava/nio/ByteBuffer;->put(B)Ljava/nio/ByteBuffer;

    goto :goto_0
.end method
